home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / extrudeToolScript.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  4.6 KB  |  171 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. // Alias|Wavefront Script File
  19. // MODIFY THIS AT YOUR OWN RISK
  20. //
  21. // Creation Date:  14 January 1999
  22. // Author:         sw
  23. //
  24. //
  25. //  Procedure Name:
  26. //      extrudeToolScript
  27. //
  28. //  Description:
  29. //    create wrapper around the extrude command
  30. //
  31. //  Input Arguments:
  32. //        0 ==> do the command.
  33. //        1 ==> show the action option box
  34. //        2 ==> return the command
  35. //        3 ==> show tool option box
  36. //        4 ==> enter the tool
  37. //
  38. //  Return Value:
  39. //      None.
  40. //
  41.  
  42. global proc extrudeToolSetup( int $forceFactorySettings, string $goToTool )
  43. {
  44.     if( $forceFactorySettings || !`optionVar -ex extrudeEuc` ) {
  45.         optionVar -iv extrudeEuc 0;
  46.     }
  47.     if( $forceFactorySettings || !`optionVar -ex extrudeLac` ) {
  48.         optionVar -iv extrudeLac 1;
  49.     }
  50.     if( "" != $goToTool ) {
  51.         scriptCtx -e -euc `optionVar -q extrudeEuc` $goToTool;
  52.         scriptCtx -e -lac `optionVar -q extrudeLac` $goToTool;
  53.     }
  54. }
  55.  
  56. global proc extrudeValues ( string $toolName ) 
  57. {
  58.     performExtrude 3 $toolName;
  59.     scriptCtxCommonValues( $toolName );
  60. }
  61.  
  62. global proc extrudeProperties()
  63. {
  64.     scriptCtxCommonProperties;
  65. }
  66.  
  67. proc createExtrudeContext( string $tool, int $needPath )
  68. {
  69.     if( ! `scriptCtx -exists $tool` ) {
  70.         extrudeToolSetup( 0, "" );
  71.         if( $needPath ) {
  72.             scriptCtx -i1 "extrude.xpm"
  73.                 -title "Extrude Tool"
  74.                 -bcn "extrude"
  75.  
  76.                 -exitUponCompletion `optionVar -q extrudeEuc`
  77.                 -totalSelectionSets 2
  78.                 -expandSelectionList true
  79.                 -showManipulators true
  80.                 -cumulativeLists true
  81.  
  82.                 -fcs ("extrudeToolScript 0")
  83.  
  84.                 -setNoSelectionPrompt ("Select curve, isoparm " +
  85.                                        "or trim edge to be extruded.")
  86.                 -setSelectionPrompt ( "Press ENTER to " +
  87.                                      "select the path." )
  88.  
  89.                 -setAutoToggleSelection true
  90.                 -setAutoComplete `optionVar -q extrudeLac`
  91.                 -setSelectionCount 1
  92.                 -nurbsCurve true
  93.                 -isoparm true
  94.                 -curveOnSurface true
  95.                 -surfaceEdge true
  96.                 -polymeshEdge true
  97.             
  98.                 -setNoSelectionPrompt ("Select curve, isoparm " +
  99.                                        "or trim edge for the extrude path.")
  100.                 -setSelectionPrompt ("Press ENTER to compute extrude.")
  101.  
  102.                 -setAutoToggleSelection true
  103.                 -setAutoComplete `optionVar -q extrudeLac`
  104.                 -setSelectionCount 1
  105.                 -nurbsCurve true
  106.                 -isoparm true
  107.                 -curveOnSurface true
  108.                 -surfaceEdge true
  109.                 -polymeshEdge true
  110.                 $tool;
  111.         }
  112.         else {
  113.             scriptCtx -i1 "extrude.xpm"
  114.                 -title "Extrude Tool"
  115.                 -bcn "extrude"
  116.  
  117.                 -exitUponCompletion `optionVar -q extrudeEuc`
  118.                 -totalSelectionSets 1
  119.                 -expandSelectionList true
  120.                 -showManipulators true
  121.                 -cumulativeLists true
  122.  
  123.                 -fcs ("extrudeToolScript 0")
  124.  
  125.                 -setNoSelectionPrompt ("Select curve(s), isoparm(s) " +
  126.                                        "or trim edge(s) to be extruded.")
  127.                 -setSelectionPrompt ("Select next curve, isoparm or trim " +
  128.                                      "edge or press ENTER to extrude.")
  129.  
  130.                 -setAutoToggleSelection true
  131.                 -setAutoComplete `optionVar -q extrudeLac`
  132.                 -setSelectionCount 0
  133.                 -nurbsCurve true
  134.                 -isoparm true
  135.                 -curveOnSurface true
  136.                 -surfaceEdge true
  137.                 -polymeshEdge true
  138.             
  139.                 $tool;
  140.         }
  141.     }
  142. }
  143.  
  144. global proc string extrudeToolScript( int $setToTool )
  145. //
  146. //    Description :
  147. //        0 ==> do the command.
  148. //        1 ==> show the action option box
  149. //        2 ==> return the command
  150. //        3 ==> show tool/action option box
  151. //        4 ==> enter the tool/do the command
  152. {
  153.     string $tool = "";
  154.     if( $setToTool > 2 ) {
  155.         if( !`optionVar -q modelWithToolExtrude` ) {
  156.             $setToTool = 4 - $setToTool;
  157.         }
  158.         else {
  159.             int $needPath = `optionVar -q extrudeStyle`;
  160.             if( $needPath ) {
  161.                 $tool = "extrudeContextPath";
  162.             }
  163.             else {
  164.                 $tool = "extrudeContext";
  165.             }
  166.             createExtrudeContext( $tool, $needPath );
  167.         }
  168.     }
  169.     return scriptToolScript( "performExtrude", $setToTool, $tool );
  170. }
  171.